package book;


import IOperation.AddBook;

import java.util.Arrays;

public class Booklist {

    Book[] books = new Book[10];
    int bookslen = books.length;

    //个数
   public int bookCount;

    //先放4本书
    public Booklist() {

        //存放书籍
        books[0] = new Book("三国演义","罗贯中","小说",84.0) ;
        books[1] = new Book("水浒传","施耐庵","小说",27.2) ;
        books[2] = new Book("西游记","吴承恩","小说",27.2) ;
        books[3] = new Book("红楼梦","曹雪芹","小说",108.2) ;

        this.bookCount = 4;
    }

    //获取和设置方法


    public int getBookCount() {
        return bookCount;
    }

    public Book getBooks(int pos) {
        return books[pos];
    }

    public Book[] getBooks() {
        return books;
    }

    public void setBookCount(int bookCount) {
        this.bookCount = bookCount;
    }

    public void setBooks(int pos, Book book) {
        this.books[pos] = book;
    }
}
